package com.base.cn.platform.os.service.course.qa.qaattend;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.course.CourseBaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 问答旁听Service
 * @author LIZHIPENG
 * @since 2018/4/26
 */
@FeignClient(name = CourseBaseService.appName, configuration = FeignAuthConfig.class)
public interface QaAttendService extends CourseBaseService {

    /**
     * 保存旁听支付添加记录
     * @param qaAttendList
     */
    @RequestMapping(contextPath + "/addAttend")
    void addAttend(@RequestBody List<Map<String, Object>> qaAttendList);
    /**
     * 条件查询围观数量
     * @param params
     * @return
     */
    @RequestMapping(contextPath + "/attendCount")
    BigDecimal attendCount(@RequestBody Map<String, Object> params);

    /**
     * 分页查询问题旁听列表
     * @param currentPage 页码
     * @param pageSize 每页显示条数
     * @param qaAttend 条件
     * @param createUserData 是否设置学员数据：true：是，false：否
     * @return
     */
    @RequestMapping(contextPath + "/findQaAttendListPage")
    Map<String, Object> findQaAttendListPage(@RequestParam(value = "currentPage", required = false, defaultValue = "1") int currentPage,
                                             @RequestParam(value = "pageSize", required = false, defaultValue = "10") int pageSize,
                                             @RequestBody Map<String, Object> qaAttend,
                                             @RequestParam("createUserData") boolean createUserData);

    /**
     * 多条件查询围观列表
     * @param attend 查询条件
     * @param crateUserData 是否设置用户对象
     * @return List<QaAttend>
     */
    @RequestMapping(contextPath + "/findQaAttendList")
    List<Map<String, Object>> findQaAttendList(@RequestBody Map<String, Object> attend, @RequestParam("crateUserData") boolean crateUserData);

}
